#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

find(int arr[],int sz,int* pnum1,int* pnum2) {
	int tmp = 0;
	for (int i = 0; i < sz; i++) {
		tmp ^= arr[i];
	}
	int pos = -1;
	for (int i = 0; i < 32; i++) {
		if ((tmp & 1) == 1) {
			pos = i;
			break;
		}
		tmp = tmp >> 1;
	}
	for (int i = 0; i < sz; i++) {
		if (((arr[i] >> pos) & 1) == 1) {
			*pnum1^= arr[i];
		}
		else
			*pnum2^= arr[i];	
	}
}

int main() {
	int arr[] = { 1,2,3,4,5,1,2,3,4,6};
	int a = 0;
	int b = 0;
	find(arr, sizeof(arr) / sizeof(arr[0]), &a, &b);
	printf("%d %d", a, b);
}